<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
</body>
<script>
   let div = document.createElement('div');
   let h1 = document.createElement('h1');
   let span = document.createElement('span');
   h1.innerHTML = '我是标题'
   span.innerHTML = '小木 su 7'

   div.id = 'container'
   h1.className = 'title'
   span.setAttribute('price','20w');
   div.appendChild(h1)
   div.appendChild(span)

   document.body.appendChild(div);

</script>
</html>